package com.city.itis.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.city.itis.dao.GuestDao;
import com.city.itis.domain.Guest;
import com.city.itis.service.GuestService;

/**
 * 用户业务层实现类
 * @author WY
 *
 */
@Component("guestService")
public class GuestServiceImpl implements GuestService 
{
	private GuestDao guestDao;
	
	public GuestDao getGuestDao() {
		return guestDao;
	}
    @Resource
	public void setGuestDao(GuestDao guestDao) {
		this.guestDao = guestDao;
	}

	@Override
	public int add(Guest guest) {
		return this.guestDao.save(guest);
	}

	@Override
	public int delete(Guest guest) {
		
		return guestDao.delete(guest);
	}

	@Override
	public int deleteById(Integer id) {
		return guestDao.deleteById(id);
	}

	@Override
	public int modify(Guest guest) {
		return guestDao.update(guest);
	}

	@Override
	public Guest getGuestById(Integer id) {
		return guestDao.getGuestById(id);
	}

	@Override
	public List<Guest> findAll() {
		return guestDao.findAll();
	}
	@Override
	public int login(Integer id, String password) {
		return guestDao.login(id, password);
	}

}
